package ltd.newbee.cloud.api;

import com.sun.org.apache.regexp.internal.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ConsumerTestController {
    @Autowired
    private RestTemplate template;

    private final String SERVICE_URL = "http://newbee-cloud-goods-service";

    //测试方法，暂未通过Nacos调用下级服务
    @GetMapping("/nacosRegtest")
    public String nacosRegtest() {
        return "nacosRegtest";
    }

    @GetMapping("/consumerTest")
    public String consumerTest() {
        return template.getForObject(SERVICE_URL + "/goodServiceTest", String.class);
    }
}
